package com.qdu.servlet;

import com.qdu.entity.Users;
import com.qdu.service.UsersService;
import com.qdu.service.impl.UsersServiceImpl;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 该Servlet负责处理修改学生信息的请求
 *
 * @author Anna
 */
@WebServlet("/mss")
public class ModifyUsersServlet extends HttpServlet {
UsersService ss = new UsersServiceImpl();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        

        req.setCharacterEncoding("utf-8");
        String Uname = req.getParameter("Uname");
        String Uid = req.getParameter("Uid");
        String Ugender = req.getParameter("Ugender");
        String Uphone = req.getParameter("Uphone");
        String Ucity = req.getParameter("Ucity");
        String Uocp = req.getParameter("Uocp");
        String Uemail = req.getParameter("Uemail");
        int Uno = Integer.parseInt(req.getParameter("Uno"));

        Users user = new Users(Uname, Uid, Ugender, Uphone, Ucity, Uocp, Uemail,Uno);


       int rows = ss.modifyUsers(user);
        

        resp.getWriter().print(rows);
        
    }
}
